package com.by.service.impl;

import com.by.bean.Dict;
import com.by.mapper.DictMapper;
import com.by.service.DictService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

@Service
public class DictServiceImpl implements DictService {
    @Autowired
    DictMapper dictMapper;

    /**
     * 添加
     * @param dict
     * @return
     */
    @Override
    public int save(Dict dict) {
        return dictMapper.save(dict);
    }

    /**
     * 根据父id查询
     * @param pid
     * @return
     */
    @Override
    public List<Map> query(int pid) {
        return dictMapper.query(pid);
    }

    /**
     * 修改
     * @param dict
     * @return
     */
    @Override
    public int update(Dict dict) {
        return dictMapper.update(dict);
    }

    /**
     * 删除
     * @param id
     * @return
     */
    @Override
    public int delete(Serializable id) {
        return dictMapper.delete(id);
    }
}
